<?php
namespace app\index\controller;


use think\Db;
use think\Validate;

class Index
{
    static $sing = 'zhIFS7IliYay';

    public function index()
    {

    }

    public function qrcode()
    {
        $sign = input('sign');

        $validate = Validate::make([
            'sign'=>'require|max:30',
        ],[],[
            'sign'  => '签名',
        ]);

        if (!$validate->check([
            'sign'=>$sign,
        ])) {
            return false;
        }


        $res = Db::table('tp_qrcode')->where([
            ['sign','=',$sign],
            ['status','=',1],
            ['isdelete','=',0],
        ])->find();

        if(!$res) abort(404);

        echo '<title>二维码名片</title><div align="center"><img width="100%" src="'.$res['wx_url'].'" /></div>';
    }

}
